package com.drp.provider;

import org.apache.ibatis.jdbc.SQL;

import java.util.List;

public class MarketProvider {
    public String lookMarket(String name,String kind){
        return new SQL(){
            {
                String str=" g_id,g_name,g_factory,g_price,g_sole,g_number FROM t_goods INNER JOIN t_kind on fk_kindId=k_id where 1=1 ";
                if(kind!=null&&!kind.equals("")){
                    str+=" and k_name like '%"+kind+"%' ";
                }
                if(name!=null&&!name.equals("")){
                    str+=" and g_name like '%"+name+"%'";
                }
                SELECT(str);
            }
        }.toString();
    }
}
